package com.health.system.dao.system;

import java.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.health.system.javacommon.base.BaseIbatis3Dao;
import com.health.system.model.system.*;
import com.health.system.dao.system.*;
import com.health.system.service.system.impl.*;
import com.health.system.service.system.*;
import org.springframework.stereotype.Component;


@Component
public class UserRoleDao extends BaseIbatis3Dao<UserRole,java.lang.String>{

	public Class getEntityClass() {
		return UserRole.class;
	}
	
	public void saveOrUpdate(UserRole entity) {
		if(entity.getId() == null) 
			save(entity);
		else 
			update(entity);
	}
	
	public Page findByPageRequest(PageRequest pageRequest) {
		return pageQuery("UserRole.pageSelect",pageRequest);
	}
	/**bzq add */
	public List getUserRoleList(java.lang.String userId){
		return getList("UserRole.getUserRoleList",userId);
	}
	/**bzq add */
	public void deleteUserRoleList(java.lang.String userId){
		int i = delete("UserRole.deleteUserRoleList",userId);
	}
	/**
	 * 查询操作员的角色树
	 * @param userId 操作员ID
	 * @return
	 */
	public List getUserRoleTree(String userId){
		return getList("UserRole.getUserRoleTree",userId);
	}
}
